import React, {PureComponent} from "react"
import {withRouter} from "react-router"
import audit from "../../../../images/common/casting-call.svg"
import { MonitorOutlined, NotificationOutlined } from '@ant-design/icons';
import { Button, notification } from "antd";
import {rootPath} from "../../../../shared/init"

@withRouter
export default class UnderReview extends PureComponent {

  onUrge = () => {
    const key = `open${Date.now()}`;
    const btn = (
      <Button type="primary" size="small" onClick={() => notification.close(key)}>
        知道了
      </Button>
    )
    notification.success({
      message: '操作提示',
      description: `已提交你的催办申请，管理员会尽快处理您的请求！`,
      duration: 3,
      btn,
      key,
      style: {
        width: 300,
        marginLeft: 90,
      },
    })
  }

  onView = () => {
    const {history} = this.props
    history.push(`/${rootPath}/my-shop/view`)
  }

  render() {
    return (
      <div className={'no-shop'}>
        <div className={'no-shop-box'}>
          <div className={'no-shop-icon'}>
            <img src={audit}/>
          </div>
          <div className={'no-shop-h1'}>
            你的门店正在审核中，请耐心等待
          </div>
          <div className={'no-shop-h2'}>
            审核结果会以手机短信、邮件或平台消息方式通知，请注意关注
          </div>
          <div className={'no-shop-button-box'}>
            <Button size={'large'} type={'primary'} ghost onClick={this.onUrge}>
              <NotificationOutlined /> 我要催办
            </Button>
            <span style={{display: 'inline-block', width: '20px'}}></span>
            <Button size={'large'} type={'primary'} onClick={this.onView}>
              <MonitorOutlined /> 查看提交信息
            </Button>
          </div>
        </div>
      </div>
    );
  }
}